]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tests/perf: Add test for shutdown with open window
authorJonas Ådahl <jadahl@gmail.com>
Fri, 24 Mar 2023 09:22:41 +0000 (10:22 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Thu, 20 Apr 2023 12:49:38 +0000 (14:49 +0200)
This would without the applied fix trigger
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6536.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2722>

js/js-resources.gresource.xml
js/perf/closeWithActiveWindows.js [new file with mode: 0644]
tests/meson.build

index ba481aafa8af637440bb3e178404e6196b450c10..c6e47915003884fdfb5b4ffc5ee2de22562f7efb 100644 (file)
@@ -36,6 +36,7 @@
     <file>misc/weather.js</file>
 
     <file>perf/basic.js</file>
+    <file>perf/closeWithActiveWindows.js</file>
     <file>perf/core.js</file>
     <file>perf/headlessStart.js</file>
     <file>perf/hwtest.js</file>
diff --git a/js/perf/closeWithActiveWindows.js b/js/perf/closeWithActiveWindows.js
new file mode 100644 (file)
index 0000000..699b51a
--- /dev/null
@@ -0,0 +1,29 @@
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
+/* exported run */
+/* eslint camelcase: ["error", { properties: "never", allow: ["^script_", "^malloc", "^glx", "^clutter"] }] */
+
+const Main = imports.ui.main;
+const Scripting = imports.ui.scripting;
+
+/** Run test. */
+async function run() {
+    /* eslint-disable no-await-in-loop */
+
+    /* Make created windows remain visible during exit. */
+    Scripting.disableHelperAutoExit();
+
+    Main.overview.hide();
+    await Scripting.waitLeisure();
+    await Scripting.sleep(1000);
+
+    await Scripting.createTestWindow({
+        width: 640,
+        height: 480,
+    });
+
+    await Scripting.waitTestWindows();
+    await Scripting.waitLeisure();
+    await Scripting.sleep(1000);
+
+    /* eslint-enable no-await-in-loop */
+}
index 088a0ce5db50fa151fbad6394a9a45c3a4bac84a..85339dd141acd1b1b48a920bc5769bd1db292551 100644 (file)
@@ -39,6 +39,9 @@ perf_tests = [
   {
     'name': 'basic',
   },
+  {
+    'name': 'closeWithActiveWindows',
+  },
   {
     'name': 'headlessStart',
     'options': ['--hotplug'],